<template>
  <div
    id="CompletionNodeCheck"
    :class="{ smallFontSize: showEdition, mediumFontSize: !showEdition }"
  >
    <div v-if="show">
      <div class="top">
        <img
          style="width: 80%; margin: 0 auto"
          src="https://nfzjszlb.jst.zj.gov.cn/serverfile/zheliban/icon/YPC/13.png"
        />
        <p>
          <span style="width: 27%; display: inline-block; text-align: center"
            >项目基本信息</span
          >
          <span style="width: 45%; display: inline-block; text-align: center"
            >签订合同</span
          >
          <span style="width: 25%; display: inline-block; text-align: center"
            >申请验收</span
          >
        </p>
      </div>
      <p
        class="title"
        :class="{
          titleSmallFontSize: showEdition,
          titleMediumFontSize: !showEdition,
        }"
        style="clear: both"
      >
        <span class="line"></span>
        节点检查
      </p>
      <van-field
        readonly
        clickable
        name="picker"
        :value="value"
        label="脚手架"
        placeholder="点击选择脚手架"
        right-icon="arrow"
        @click="showPicker = true"
      />
      <van-popup v-model="showPicker" position="bottom" get-container="#popup">
        <van-picker
          show-toolbar
          :columns="columns"
          @confirm="onConfirm"
          @cancel="showPicker = false"
        />
      </van-popup>
      <div v-if="contentShow" class="content">
        <ul>
          <li
            v-if="item.state"
            v-for="(item, index) in contentData1"
            :key="index"
            :style="{
              background:
                'url(https://nfzjszlb.jst.zj.gov.cn/serverfile/zheliban/icon/ZLJ/SGRZ/' +
                item.bg +
                '.png)',
              paddingLeft: '20px',
            }"
            @click="contentData1Click(item)"
          >
            <p style="margin-bottom: 8px">
              <span style="width: calc(100% - 70px); display: inline-block">
                <div>{{ item.proc_name }}</div>
              </span>
            </p>
          </li>
        </ul>
        <p
          :class="{
            titleSmallFontSize: showEdition,
            titleMediumFontSize: !showEdition,
          }"
          class="title"
          style="clear: both"
        >
          <span class="line"></span>
          施工日志
        </p>
        <div style="padding: 10px; text-align: center">
          <div @click="addSGRZ()" class="addSGRZ">
            <span style="width: 65%; display: inline-block">添加施工日志</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { FileServerProxy } from "../../utils/api";
export default {
  data() {
    return {
      contentShow: true,
      showEdition: false,
      show1: false,
      dataValue: "",
      listData: [
        {
          name: "放样",
          children: [
            {
              name: "四边长度",
              groupGuid: "b9bcaba3-82f1-4c9b-8585-9ec7d0d7aed6",
              fileList: [],
            },
          ],
        },
        {
          name: "地基钢筋",
          children: [
            {
              name: "规格寄照片",
              groupGuid: "e1949021-c239-4473-95d0-35b260103e2f",
              fileList: [],
            },
          ],
        },
        {
          name: "基础",
          children: [
            {
              name: "轴线尺寸",
              groupGuid: "8c853bca-2a3d-4a73-b7b6-34ea098b2ce0",
              fileList: [],
            },
            {
              name: "混凝土强度",
              groupGuid: "816f51d2-1f28-4fe3-8679-75b21503fbed",
              fileList: [],
            },
            {
              name: "防水",
              groupGuid: "6db48286-81df-49e6-89d7-ee48b915931a",
              fileList: [],
            },
            {
              name: "管线预埋",
              groupGuid: "509b147c-c6dc-43f0-8477-3a6bee96874a",
              fileList: [],
            },
            {
              name: "结构预埋件",
              groupGuid: "7c2d50e1-3499-4173-a6ee-782b75949d74",
              fileList: [],
            },
          ],
        },
        {
          name: "一层",
          children: [
            {
              name: "层高",
              groupGuid: "3e319216-491b-42e7-9b49-502eec61a6c8",
              fileList: [],
            },
            {
              name: "楼面尺寸",
              groupGuid: "11c1ce8f-601b-4e83-aec8-309de8b88ce7",
              fileList: [],
            },
            {
              name: "梁柱及板钢筋照片",
              groupGuid: "b717d43e-cc51-4647-a096-f017dd236062",
              fileList: [],
            },
          ],
        },
        {
          name: "二层",
          children: [
            {
              name: "层高",
              groupGuid: "1fadb4fd-87ee-456c-a19c-04d7f2526615",
              fileList: [],
            },
            {
              name: "楼面尺寸",
              groupGuid: "37afcffe-26a5-40a3-ac6d-0a36ef16fde9",
              fileList: [],
            },
            {
              name: "梁柱及板钢筋照片",
              groupGuid: "691c6c0f-8baa-4425-8211-f2f9bee429dc",
              fileList: [],
            },
          ],
        },
        {
          name: "三层",
          children: [
            {
              name: "层高",
              groupGuid: "71081664-56ba-4676-b14c-b569b181153f",
              fileList: [],
            },
            {
              name: "楼面尺寸",
              groupGuid: "c5b125ad-21a9-4768-b60f-e8038d89e3a9",
              fileList: [],
            },
            {
              name: "梁柱及板钢筋照片",
              groupGuid: "c5b125ad-21a9-4768-b60f-e8038d89e3a9",
              fileList: [],
            },
          ],
        },
        {
          name: "结顶",
          children: [
            {
              name: "顶高",
              groupGuid: "8486d5b6-4b96-4b9b-96b3-8a3c80fae57c",
              fileList: [],
            },
            {
              name: "檐口高",
              groupGuid: "2bb5cf21-d68f-47c4-8e1f-2fb3218f9d09",
              fileList: [],
            },
            {
              name: "滴水尺寸",
              groupGuid: "5d79e0f3-3acf-4ed9-8dc3-14dbc96d955b",
              fileList: [],
            },
            {
              name: "房屋坡度",
              groupGuid: "2ac8070b-787d-4fe5-a788-3049e59aaebc",
              fileList: [],
            },
            {
              name: "避雷",
              groupGuid: "fe9109db-3b5e-4cd8-abcd-be0cdb937270",
              fileList: [],
            },
          ],
        },
        {
          name: "外立面",
          children: [
            {
              name: "四周照片",
              groupGuid: "8978af55-f704-4d68-b660-3de9817dc42c",
              fileList: [],
            },
          ],
        },
        {
          name: "隐蔽工程",
          children: [
            {
              name: "水电",
              groupGuid: "91047b97-80ac-47c7-a2d5-bd708d1f1ec0",
              fileList: [],
            },
            {
              name: "防水",
              groupGuid: "d525a87f-dd62-4c1d-93c3-b376cac502b9",
              fileList: [],
            },
          ],
        },
      ],
      show: true,
      //   contentData: [
      //     {
      //       proc_name: "定位放样",
      //       bg: "1",
      //       isRed: false,
      //     },
      //     {
      //       proc_name: "基槽验线",
      //       bg: "2",
      //       isRed: false,
      //     },
      //     {
      //       proc_name: "一层立模",
      //       bg: "3",
      //       isRed: false,
      //     },
      //     {
      //       proc_name: "竣工验收",
      //       bg: "4",
      //       isRed: false,
      //     },
      //   ],
      contentData: [],
      contentData1: [
        {
          index: "dj",
          proc_name: "地基和基础施工质量验收表",
          bg: "1",
          state: true,
        },
        {
          index: "kj",
          proc_name: "扣件式钢管脚手架验收表",
          bg: "2",
          state: true,
        },
        {
          index: "js",
          proc_name: "竹脚手架检查验收表",
          bg: "3",
          state: false,
        },
        {
          index: 3,
          proc_name: "砖砌体结构质量检查和验收表",
          bg: "4",
          state: true,
        },
        {
          index: 4,
          proc_name: "现浇混凝土结构质量检查和验收",
          bg: "5",
          state: true,
        },
        {
          index: "jg",
          proc_name: "结构工程施工质量验收",
          bg: "9",
          state: true,
        },
      ],

      fileList: [],
      rowGuid: "",
      isSave: false,
      value: "扣件式钢管脚手架验收表",
      columns: ["扣件式钢管脚手架验收表", "竹脚手架检查验收表"],
      showPicker: false,
      SaveData: "",
      shoulm: false,
      isRed: false,
      text: {
        title: "提示",
        message: "请确认是否发起定位放样申请?",
        btn: {
          okText: "确定",
          cancelText: "取消",
        },
      },
      text1: {
        title: "提示",
        message: "请确认是否需要更换工匠?",
        btn: {
          okText: "确定",
          cancelText: "取消",
        },
      },
      shoulm1: false,
      isht: true,
    };
  },
  methods: {
    onConfirm(value) {
      this.value = value;
      if (value == "竹脚手架检查验收表") {
        this.contentData1.forEach((res) => {
          if (res.index == "js") {
            res.state = true;
          }
          if (res.index == "kj") {
            res.state = false;
          }
        });
      }
      if (value == "扣件式钢管脚手架验收表") {
        this.contentData1.forEach((res) => {
          if (res.index == "kj") {
            res.state = true;
          }
          if (res.index == "js") {
            res.state = false;
          }
        });
      }
      //   this.contentData1.forEach((item) => {
      //     if (item.proc_name == value && value == "扣件式钢管脚手架验收表") {
      //       item.state = true;
      //     } else if (item.proc_name == "竹脚手架检查验收表") {
      //       item.state = false;
      //     } else if (item.proc_name == value && value == "竹脚手架检查验收表") {
      //       item.state = true;
      //     } else if (item.proc_name == "扣件式钢管脚手架验收表") {
      //       item.state = false;
      //     }
      //     // if(value=="竹脚手架检查验收表"){
      //     //  this.contentData1[item].state=true;
      //     // }
      //   });
      //   if (value == "扣件式钢管脚手架验收表") {
      //     this.contentData1.forEach((item) => {
      //       if (item.proc_name == value) {
      //         item.state = true;
      //       }
      //     });
      //   }

      this.showPicker = false;
      //   this.contentData1.push(
      //     {
      //       proc_name: "二层",
      //       bg: "7",
      //       state:true,
      //     },
      //);
      //this.updateData();
    },
    //点击节点检查
    contentData1Click(item) {
      ;
      switch (item.bg) {
        case "1":
          this.$router.push({
            path: "/DJHJCSG",
            query: {
              data: JSON.stringify(this.tableData),
              data1: JSON.stringify(item),
            },
          });
          break;
        case "2":
          this.$router.push({
            path: "/GGJSJ",
            query: {
              data: JSON.stringify(this.tableData),
              data1: JSON.stringify(item),
              number: this.tableData.BUILDSTOREY
            },
          });
          break;
        case "3":
          this.$router.push({
            path: "/ZJSJJCYSB",
            query: {
              data: JSON.stringify(this.tableData),
              data1: JSON.stringify(item),
              number: this.tableData.BUILDSTOREY,
            },
          });
          break;

        case "4":
          this.$router.push({
            path: "/ZQTJGZL",
            query: {
              data: JSON.stringify(this.tableData),
              data1: JSON.stringify(item),
              number: this.tableData.BUILDSTOREY,
            },
          });
          break;
        case "5":
          this.$router.push({
            path: "/XJHNT",
            query: {
              data: JSON.stringify(this.tableData),
              data1: JSON.stringify(item),
              number: this.tableData.BUILDSTOREY,
            },
          });
          break;
        case "7":
          this.$router.push({
            path: "/formworkErection",
            query: {
              data: JSON.stringify(this.tableData),
              data1: JSON.stringify(item),
              number: item.proc_name,
            },
          });
          break;
        case "9":
          this.$router.push({
            path: "/JGGCSGZLYSB",
            query: {
              data: JSON.stringify(this.tableData),
              data1: JSON.stringify(item),
            },
          });
          break;
      }
    },
    //    contentData1Click(item) {
    //       switch (item.proc_name) {
    //         case '一层':
    //           this.$router.push({
    //             path: '/formworkErection',
    //             query: {
    //               data: JSON.stringify(this.tableData),
    //               data1: JSON.stringify(item),
    //               number: '一层'
    //             }
    //           })
    //           break
    //         case '二层':
    //           this.$router.push({
    //             path: '/formworkErection',
    //             query: {
    //               data: JSON.stringify(this.tableData),
    //               data1: JSON.stringify(item),
    //               number: '二层'
    //             }
    //           })
    //           break
    //         case '三层':
    //           this.$router.push({
    //             path: '/formworkErection',
    //             query: {
    //               data: JSON.stringify(this.tableData),
    //               data1: JSON.stringify(item),
    //               number: '三层'
    //             }
    //           })
    //           break
    //         case '地基和基础施工质量验收':
    //           this.$router.push({
    //             path: '/DJHJCSG',
    //             query: {
    //               data: JSON.stringify(this.tableData),
    //               data1: JSON.stringify(item)
    //             }
    //           })
    //           break
    //         case '结构工程施工质量验收':
    //           this.$router.push({
    //             path: '/JGGCSGZLYSB',
    //             query: {
    //               data: JSON.stringify(this.tableData),
    //               data1: JSON.stringify(item)
    //             }
    //           })
    //           break
    //       }
    //     },
    //     //弹出框
    //    showPopup(data) {
    //       this.dataValue = data.proc_name
    //       this.SaveData = data
    //       //工匠暂不支持定位放样以及三个环节的提交
    //       if(data.proc_name == '定位放样' && window.localStorage.getItem('isGJM') == 'false'){
    //         this.$toast.fail('工匠暂不支持定位放样')
    //       } else{
    //         if (this.$store.state.HJZT === 4 && data.proc_name == '定位放样') {
    //         this.show1 = true
    //         this.shoulm1 = true
    //       } else if (this.$store.state.HJZT === 6 && data.proc_name == '基槽验线') {
    //         this.handleButton()
    //       } else if (this.$store.state.HJZT === 8 && data.proc_name == '一层立模') {
    //         this.handleButton()
    //       } else if (this.$store.state.HJZT === 7 && data.proc_name == '竣工验收') {
    //         this.handleButton()
    //       } else {
    //         this.$toast.fail('暂未到此环节！')
    //       }
    //       }
    //     },
    //    handleButton(data) {
    //   if (data == '取消') {
    //         this.show1 = false
    //       } else {
    //         switch (this.dataValue) {
    //           case '基槽验线':
    //             this.$router.push({
    //               path: '/DJHJCSG',
    //               query: {
    //                 data: JSON.stringify(this.tableData),
    //                 data1: JSON.stringify(this.SaveData),
    //               }
    //             })
    //             break
    //           case '竣工验收':
    //             this.$router.push({
    //               path: '/JGGCSGZLYSB',
    //               query: {
    //                 data: JSON.stringify(this.tableData),
    //                 data1: JSON.stringify(this.SaveData),
    //                 data2:'竣工验收'
    //               }
    //             })
    //             break
    //           case '定位放样':
    //             this.handleClick(this.SaveData)
    //             this.show1 = false
    //             break
    //           case '一层立模':
    //             this.$router.push({
    //               path: '/formworkErection',
    //               query: {
    //                 data: JSON.stringify(this.tableData),
    //                 data1: JSON.stringify(this.SaveData),
    //                 number: '一层',
    //                 data2:'一层立模'
    //               }
    //             })
    //             break
    //         }
    //       }
    //     },
    //     handleClick: async function (data) {
    //       //调用当前环节的接口
    //       if (!this.$store.state.isGJ) {
    //         if (
    //           (this.$store.state.HJZT === 4 && data.proc_name != '定位放样') ||
    //           (this.$store.state.HJZT === 6 && data.proc_name != '基槽验线') ||
    //           (this.$store.state.HJZT === 8 && data.proc_name != '一层立模') ||
    //           (this.$store.state.HJZT === 7 && data.proc_name != '竣工验收')
    //         ) {
    //           this.$toast.fail('未到此环节!')
    //         }
    //         if (this.$store.state.HJZT === 4 && data.proc_name == '定位放样') {
    //           setTimeout(() => {
    //             this.$router.push({
    //               path: '/TreeSelectZL',
    //               query: {
    //                 data: { TASK_ID: this.tableData,isdwfy:1 },
    //                 data2:'定位放样'
    //               }
    //             })
    //           }, 500)
    //         } else if (this.$store.state.HJZT === 6 && data.proc_name == '基槽验线') {
    //           setTimeout(() => {
    //             this.$router.push({
    //               path: '/TreeSelectZL',
    //               query: {
    //                 data: { TASK_ID: this.tableData,isyclm:1 },
    //                 data2:'基槽验线',

    //               }
    //             })
    //           }, 500)
    //         } else if (this.$store.state.HJZT === 8 && data.proc_name == '一层立模') {
    //           setTimeout(() => {
    //             this.$router.push({
    //               path: '/TreeSelectZL',
    //               query: {
    //                 data: { TASK_ID: this.tableData ,isyclm:1},
    //                 data2:'一层立模'
    //               }
    //             })
    //           }, 500)
    //         } else if (this.$store.state.HJZT === 7 && data.proc_name == '竣工验收') {
    //           setTimeout(() => {
    //             this.$router.push({
    //               path: '/TreeSelectZL',
    //               query: {
    //                 data: { TASK_ID: this.tableData,isjgys:1 },
    //                 data2:'竣工验收'
    //               }
    //             })
    //           }, 500)
    //         }
    //       }else {
    //         if (
    //           (this.$store.state.HJZT === 4 && data.proc_name != "定位放样") ||
    //           (this.$store.state.HJZT === 6 && data.proc_name != "基槽验线") ||
    //           (this.$store.state.HJZT === 8 && data.proc_name != "一层立模") ||
    //           (this.$store.state.HJZT === 7 && data.proc_name != "竣工验收")
    //         ) {
    //           this.$toast.fail("未到此环节!");
    //         }
    //         if (this.$store.state.HJZT === 4 && data.proc_name == "定位放样") {
    //           window.localStorage.setItem("isNHCW", 1);
    //           setTimeout(() => {
    //             this.$router.push({
    //               path: "/TreeSelect",
    //               query: {
    //                 data: this.tableData,
    //                 isdwfy: 1,
    //                 isdwfyNew:1
    //               },
    //             });
    //           }, 500);
    //         } else if (
    //           this.$store.state.HJZT === 6 &&
    //           data.proc_name == "基槽验线"
    //         ) {
    //           window.localStorage.setItem("isNHCW", 1);
    //           setTimeout(() => {
    //             this.$router.push({
    //               path: "/TreeSelect",
    //               query: {
    //                 data: this.tableData,
    //                 isjcyx:1,
    //                 isjcyxNew:1
    //               },
    //             });
    //           }, 500);
    //         } else if (
    //           this.$store.state.HJZT === 8 &&
    //           data.proc_name == "一层立模"
    //         ) {
    //           window.localStorage.setItem("isNHCW", 1);
    //           setTimeout(() => {
    //             this.$router.push({
    //               path: "/TreeSelect",
    //               query: {
    //                 data: this.tableData,
    //                 isyclm:1,
    //                 isyclmNew:1
    //               },
    //             });
    //           }, 500);
    //         } else if (
    //           this.$store.state.HJZT === 7 &&
    //           data.proc_name == "竣工验收"
    //         ) {
    //           window.localStorage.setItem("isNHCW", 1);
    //           setTimeout(() => {
    //             this.$router.push({
    //               path: "/TreeSelect",
    //               query: {
    //                 data: this.tableData,
    //                 isjgys:1,
    //                 isjgysNew:1
    //               },
    //             });
    //           }, 500);
    //         }
    //       }
    //     },
    //     handleClose() {
    //       this.shoulm = false;
    //     },
    //     handleOk(data) {
    //       this.handleButton();
    //     },
    //      handleClose1() {
    //       this.shoulm1 = false;
    //       this.shoulm = true
    //     },
    //     handleOk1(data) {
    //       // this.handleButton();
    //       //更换工匠 标识
    //       window.sessionStorage.setItem('ChangeGJ',true)
    //       //跳入更换工匠页面
    //        this.$router.push({
    //         path: "craftsmanServices",
    //       });
    //     },
    //施工日志
    addSGRZ: async function () {
      //this.show = false;
      this.$router.push({
        path: "ConstructionLog",
        query: {
          data: JSON.stringify(this.tableData),
        },
      });
    },
    //根据结构显示表单以及层数
    getDataByJDYS: async function () {

      let ghjbrex = {
        procName: "up_query",
        dtParams: JSON.stringify([
          { I_USERID: "'" + this.tableData.ROW_GUID + "'", I_TYPE: 15 },
        ]),
        token: window.localStorage.getItem("token"),
      };
      let ghjbrfu = {
        accessCode: "69db6bece3a7480592e2ec753d1e335e",
        cityCode: window.localStorage.getItem("citycode")
          ? window.localStorage.getItem("citycode")
          : "441300000000",
        params: ghjbrex,
      };
      const resghjbrbe = await FileServerProxy(ghjbrfu);
      let resData = JSON.parse(resghjbrbe.data.data);
      if (resData.Data && resData.Data.length > 0) {
        if (resData.Data[0].STRUCTURETYPE == 42) {
          //现浇混泥土 隐藏砖砌,放开混凝土
          this.contentData1.forEach((items) => {
            if (items.index == "3") {
              items.state = false;
            }
          });
          //this.isht=true;
        } else {
          this.contentData1.forEach((items) => {
            if (items.index == "4") {
              items.state = false;
            }
          });
          //this.isht=false;
        }
        //循环添加层数
        if (resData.Data[0] &&  resData.Data[0].BUILDSTOREY) {
          var  cs=this.cnnumtonum(resData.Data[0].BUILDSTOREY.substring(0,1));
          for (var i = 0; i < Number(cs); i++) {
            this.contentData1.push({
              index: i + 1,
              proc_name: this.Arabia_To_SimplifiedChinese((i + 1)) + "层",
              bg: "7",
              state: true,
            });
          }
        }
      }
    },
    //大写该小写
    cnnumtonum(chnStr){
           var chnNumChar = {
               零:0,一:1,二:2,三:3,四:4,五:5,六:6,七:7,八:8,九:9
           };
         var chnNameValue = {
                 十:{value:10, secUnit:false},
                 百:{value:100, secUnit:false},
                 千:{value:1000, secUnit:false},
                 万:{value:10000, secUnit:true},
                 亿:{value:100000000, secUnit:true}
         };
        var expNumChar= {十:10,十一:11,十二:12,十三:13,十四:14,十五:15,十六:16,十七:17,十八:18,十九:19  };
        if(expNumChar[chnStr]) {      return expNumChar[chnStr];  }
        var rtn = 0;
           var section = 0;
           var number = 0;
           var secUnit = false;
           var str = chnStr.split('');
           for(var i = 0; i < str.length; i++){
               var num = chnNumChar[str[i]];
               if(typeof num !== 'undefined'){
                   number = num;
                   if(i === str.length - 1){
                       section += number;
                   }
               }else{
                     var cunit = chnNameValue[str[i]];
                     if(typeof cunit == 'undefined') {
                         return false;
                     }
                    var unit = chnNameValue[str[i]].value;
                       secUnit = chnNameValue[str[i]].secUnit;
                   if(secUnit){
                       section = (section + number) * unit;
                       rtn += section;
                       section = 0;
                   }else{
                       section += (number * unit);
                   }
                   number = 0;
               }
           }
           return rtn + section;
        },
    //阿拉伯数字转大写
    Arabia_To_SimplifiedChinese(Num) {
      for (let i = Num.length - 1; i >= 0; i--) {
        Num = Num.replace(",", ""); //替换Num中的“,”
        Num = Num.replace(" ", ""); //替换Num中的空格
      }
      if (isNaN(Num)) {
        //验证输入的字符是否为数字
        //alert("请检查小写金额是否正确");
        return;
      }
      //字符处理完毕后开始转换，采用前后两部分分别转换
      let part = String(Num).split(".");
      let newchar = "";
      //小数点前进行转化
      for (let i = part[0].length - 1; i >= 0; i--) {
        if (part[0].length > 10) {
          //alert("位数过大，无法计算");
          return "";
        } //若数量超过拾亿单位，提示
        let tmpnewchar = "";
        let perchar = part[0].charAt(i);
        switch (perchar) {
          case "0":
            tmpnewchar = "零" + tmpnewchar;
            break;
          case "1":
            tmpnewchar = "一" + tmpnewchar;
            break;
          case "2":
            tmpnewchar = "二" + tmpnewchar;
            break;
          case "3":
            tmpnewchar = "三" + tmpnewchar;
            break;
          case "4":
            tmpnewchar = "四" + tmpnewchar;
            break;
          case "5":
            tmpnewchar = "五" + tmpnewchar;
            break;
          case "6":
            tmpnewchar = "六" + tmpnewchar;
            break;
          case "7":
            tmpnewchar = "七" + tmpnewchar;
            break;
          case "8":
            tmpnewchar = "八" + tmpnewchar;
            break;
          case "9":
            tmpnewchar = "九" + tmpnewchar;
            break;
        }
        switch (part[0].length - i - 1) {
          case 0:
            tmpnewchar = tmpnewchar;
            break;
          case 1:
            if (perchar != 0) tmpnewchar = tmpnewchar + "十";
            break;
          case 2:
            if (perchar != 0) tmpnewchar = tmpnewchar + "百";
            break;
          case 3:
            if (perchar != 0) tmpnewchar = tmpnewchar + "千";
            break;
          case 4:
            tmpnewchar = tmpnewchar + "万";
            break;
          case 5:
            if (perchar != 0) tmpnewchar = tmpnewchar + "十";
            break;
          case 6:
            if (perchar != 0) tmpnewchar = tmpnewchar + "百";
            break;
          case 7:
            if (perchar != 0) tmpnewchar = tmpnewchar + "千";
            break;
          case 8:
            tmpnewchar = tmpnewchar + "亿";
            break;
          case 9:
            tmpnewchar = tmpnewchar + "十";
            break;
        }
        newchar = tmpnewchar + newchar;
      }
      //替换所有无用汉字，直到没有此类无用的数字为止
      while (
        newchar.search("零零") != -1 ||
        newchar.search("零亿") != -1 ||
        newchar.search("亿万") != -1 ||
        newchar.search("零万") != -1
      ) {
        newchar = newchar.replace("零亿", "亿");
        newchar = newchar.replace("亿万", "亿");
        newchar = newchar.replace("零万", "万");
        newchar = newchar.replace("零零", "零");
      }
      //替换以“一十”开头的，为“十”
      if (newchar.indexOf("一十") == 0) {
        newchar = newchar.substr(1);
      }
      //替换以“零”结尾的，为“”
      if (newchar.lastIndexOf("零") == newchar.length - 1) {
        newchar = newchar.substr(0, newchar.length - 1);
      }
      return newchar;
    },
    //通过建房层数自动添加

    //  newGuid(format) {
    //       //表示全局唯一标识符 (GUID)。
    //       function Guid(g) {
    //         var arr = new Array() //存放32位数值的数组
    //         if (typeof g == 'string') {
    //           //如果构造函数的参数为字符串
    //           InitByString(arr, g)
    //         } else {
    //           InitByOther(arr)
    //         }
    //         //返回 Guid 类的此实例值的 String 表示形式。
    //         this.ToString = function (format) {
    //           if (typeof format == 'string') {
    //             if (format == 'N' || format == 'D' || format == 'B' || format == 'P') {
    //               return ToStringWithFormat(arr, format)
    //             } else {
    //               return ToStringWithFormat(arr, 'D')
    //             }
    //           } else {
    //             return ToStringWithFormat(arr, 'D')
    //           }
    //         }

    //         //由字符串加载
    //         function InitByString(arr, g) {
    //           g = g.replace(/\{|\(|\)|\}|-/g, '')
    //           g = g.toLowerCase()
    //           if (g.length != 32 || g.search(/[^0-9,a-f]/i) != -1) {
    //             InitByOther(arr)
    //           } else {
    //             for (var i = 0; i < g.length; i++) {
    //               arr.push(g[i])
    //             }
    //           }
    //         }

    //         //由其他类型加载
    //         function InitByOther(arr) {
    //           // var i = 32;
    //           // while (i--) {
    //           //     arr.push("0");
    //           // }

    //           var i = 32
    //           while (i--) {
    //             arr.push(Math.floor(Math.random() * 16.0).toString(16))
    //           }
    //         }

    //         /*
    //             根据所提供的格式说明符，返回此 Guid 实例值的 String 表示形式。
    //             N  32 位： xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    //             D  由连字符分隔的 32 位数字 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    //             B  括在大括号中、由连字符分隔的 32 位数字：{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
    //             P  括在圆括号中、由连字符分隔的 32 位数字：(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)
    //             */

    //         //增加一个标识能区分开这个guid是不是由前端生成的
    //         function ToStringWithFormat(arr, format) {
    //           switch (format) {
    //             case 'N':
    //               return arr.toString().replace(/,/g, '')
    //             case 'D':
    //               var str = arr.slice(0, 8) + '-1203' + '-' + arr.slice(12, 16) + '-' + arr.slice(16, 20) + '-' + arr.slice(20, 32)
    //               str = str.replace(/,/g, '')
    //               return str
    //             case 'B':
    //               var str = ToStringWithFormat(arr, 'D')
    //               str = '{' + str + '}'
    //               return str
    //             case 'P':
    //               var str = ToStringWithFormat(arr, 'D')
    //               str = '(' + str + ')'
    //               return str
    //             default:
    //               return new Guid()
    //           }
    //         }

    //         return this.ToString()
    //       }

    //       var g = new Guid()
    //       return g.ToString(format)
    //     }
  },
  mounted() {
    ;
    this.showEdition = this.$store.state.Edition;
    // this.rowGuid = this.newGuid()
    this.tableData = JSON.parse(this.$route.query.data);
    //获取结构类型
    this.getDataByJDYS();
    // if (this.$store.state.HJZT === 4) {
    //   this.contentData[0].isRed = true
    //  } else if (this.$store.state.HJZT === 6) {
    //    this.contentData[1].isRed = true
    //  } else if (this.$store.state.HJZT === 8) {
    //    this.contentData[2].isRed = true
    //  } else if (this.$store.state.HJZT === 7) {
    //    this.contentData[3].isRed = true
    //  }
  },
};
</script>
<style lang="scss">
#CompletionNodeCheck {
  height: 100vh;
  overflow: auto;
  background: #f6f6f6;

  .buttonVan {
    width: 100%;
    padding-top: 20px;
    position: relative;

    .buttonVan1 {
      position: absolute;
      left: 15%;
    }

    .buttonVan2 {
      position: absolute;
      left: 37%;
    }
  }

  .line {
    width: 6px;
    height: 26px;
    background: #3f8ffc;
    display: inline-block;
    margin-right: 10px;
  }

  .top {
    height: 90px;
    background: #ffffff;
    margin-bottom: 20px;
    padding-top: 25px;
    text-align: center;

    .origin {
      width: 22px;
      height: 22px;
      background: #007aff;
      border-radius: 50%;
      display: inline-block;
    }

    .line {
      width: 20vw;
      /*height: 1px;*/
      border: 1px dashed #007aff;
      display: inline-block;
    }
  }

  .addSGRZ {
    width: 49%;
    height: 70px;
    background: url("https://nfzjszlb.jst.zj.gov.cn/serverfile/zheliban/icon/ZLJ/SGRZ/10.png");
    background-size: 100% 100%;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 40px;
  }

  .title {
    width: 100%;
    height: 50px;
    /*background: #007aff;*/
    line-height: 50px;
    /*text-align: center;*/
    font-size: 20px;
    position: relative;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #9b9b9b;
  }

  .content {
    background: #ffffff;
    height: calc(100vh - 160px);
    overflow: auto;
    padding: 10px;

    ul li {
      width: calc(49% - 10px);
      border-radius: 20px;
      margin-top: 10px;
      margin-left: 10px;
      height: 70px;
      background-size: 100% 100% !important;
      float: left;
      text-align: center;
      display: flex;
      justify-content: center;
      align-items: center;
    }
  }

  .btn {
    height: 80px;
    background: url("../../../static/imgs/ZLJ/52.png");
    background-size: 100% 100%;
    display: flex;
    align-items: center;
    padding-left: 70px;
    margin-bottom: 10px;
  }

  .btn1 {
    height: 80px;
    background: url("../../../static/imgs/ZLJ/53.png");
    background-size: 100% 100%;
    display: flex;
    align-items: center;
    padding-left: 70px;
  }

  .van-popup {
    border-radius: 10px;

    .con_box {
      width: 270px;
      line-height: 1;
      text-align: center;
      color: #4d5c82;
      padding: 15px;
      box-sizing: border-box;

      > h3 {
        font-size: 20px;
        margin-top: 10px;
        margin-bottom: 20px;
      }

      > p {
        font-size: 17px;
        margin-bottom: 30px;
      }

      .btnv {
        display: flex;
        justify-content: space-between;

        > span {
          display: block;
          width: 114px;
          background-color: #e0e5f5;
          text-align: center;
          line-height: 44px;
          font-size: 17px;
        }

        > span:last-of-type {
          background-color: #1288fe;
          color: #ffffff;
        }
      }
    }
  }
}
</style>
<style>
.van-uploader__wrapper {
  -webkit-flex-wrap: nowrap !important;
  flex-wrap: nowrap !important;
}
</style>
